From 7b1d024a0e92aea4d587d38a170d6fe9715dd69f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 12 Feb 2004 22:57:56 +0000 Subject: [PATCH] New function to improve the accessibility of tooltips. (#114851, Padraig Thu Feb 12 23:55:08 2004 Matthias Clasen * gtk/gtktooltips.h: * gtk/gtktooltips.c (gtk_tooltips_get_info_from_tip_window): New function to improve the accessibility of tooltips. (#114851, Padraig O'Briain) --- ChangeLog | 13 +++++++++ ChangeLog.pre-2-10 | 13 +++++++++ ChangeLog.pre-2-4 | 13 +++++++++ ChangeLog.pre-2-6 | 13 +++++++++ ChangeLog.pre-2-8 | 13 +++++++++ docs/reference/ChangeLog | 4 +++ docs/reference/gtk/gtk-sections.txt | 2 ++ gtk/gtktooltips.c | 42 +++++++++++++++++++++++++++++ gtk/gtktooltips.h | 5 ++++ 9 files changed, 118 insertions(+) diff --git a/ChangeLog b/ChangeLog index d384d49c6d..83a81acaad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Feb 12 23:55:08 2004 Matthias Clasen + + * gtk/gtktooltips.h: + * gtk/gtktooltips.c (gtk_tooltips_get_info_from_tip_window): New + function to improve the accessibility of tooltips. (#114851, + Padraig O'Briain) + +Thu Feb 12 23:16:04 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Make these public and + add docs. (#132847) + Thu Feb 12 11:05:16 2004 Manish Singh * gdk/x11/gdkproperty-x11.c (gdk_property_get): Assign xtype using diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d384d49c6d..83a81acaad 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Thu Feb 12 23:55:08 2004 Matthias Clasen + + * gtk/gtktooltips.h: + * gtk/gtktooltips.c (gtk_tooltips_get_info_from_tip_window): New + function to improve the accessibility of tooltips. (#114851, + Padraig O'Briain) + +Thu Feb 12 23:16:04 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Make these public and + add docs. (#132847) + Thu Feb 12 11:05:16 2004 Manish Singh * gdk/x11/gdkproperty-x11.c (gdk_property_get): Assign xtype using diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index d384d49c6d..83a81acaad 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Thu Feb 12 23:55:08 2004 Matthias Clasen + + * gtk/gtktooltips.h: + * gtk/gtktooltips.c (gtk_tooltips_get_info_from_tip_window): New + function to improve the accessibility of tooltips. (#114851, + Padraig O'Briain) + +Thu Feb 12 23:16:04 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Make these public and + add docs. (#132847) + Thu Feb 12 11:05:16 2004 Manish Singh * gdk/x11/gdkproperty-x11.c (gdk_property_get): Assign xtype using diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index d384d49c6d..83a81acaad 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Thu Feb 12 23:55:08 2004 Matthias Clasen + + * gtk/gtktooltips.h: + * gtk/gtktooltips.c (gtk_tooltips_get_info_from_tip_window): New + function to improve the accessibility of tooltips. (#114851, + Padraig O'Briain) + +Thu Feb 12 23:16:04 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Make these public and + add docs. (#132847) + Thu Feb 12 11:05:16 2004 Manish Singh * gdk/x11/gdkproperty-x11.c (gdk_property_get): Assign xtype using diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d384d49c6d..83a81acaad 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Thu Feb 12 23:55:08 2004 Matthias Clasen + + * gtk/gtktooltips.h: + * gtk/gtktooltips.c (gtk_tooltips_get_info_from_tip_window): New + function to improve the accessibility of tooltips. (#114851, + Padraig O'Briain) + +Thu Feb 12 23:16:04 2004 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_popup): + * gtk/gtkcombobox.c (gtk_combo_box_popdown): Make these public and + add docs. (#132847) + Thu Feb 12 11:05:16 2004 Manish Singh * gdk/x11/gdkproperty-x11.c (gdk_property_get): Assign xtype using diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index ebe2c7c1c4..84f3fedfb9 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 12 23:56:12 2004 Matthias Clasen + + * gtk/gtk-sections.txt: Add gtk_tooltips_get_info_from_tip_window. + Thu Feb 12 23:30:25 2004 Matthias Clasen * gtk/gtk-sections.txt: Add gtk_combo_box_{popup,popdown}. diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt index 420448226b..d6908af03a 100644 --- a/docs/reference/gtk/gtk-sections.txt +++ b/docs/reference/gtk/gtk-sections.txt @@ -3388,6 +3388,8 @@ gtk_tooltips_set_delay gtk_tooltips_set_tip gtk_tooltips_data_get gtk_tooltips_force_window +gtk_tooltips_get_info_from_tip_window + GTK_TOOLTIPS GTK_IS_TOOLTIPS diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c index 97bb782c7b..e747664e48 100644 --- a/gtk/gtktooltips.c +++ b/gtk/gtktooltips.c @@ -68,6 +68,7 @@ static gboolean get_keyboard_mode (GtkWidget *widget); static GtkObjectClass *parent_class; static const gchar *tooltips_data_key = "_GtkTooltipsData"; +static const gchar *tooltips_info_key = "_GtkTooltipsInfo"; GType gtk_tooltips_get_type (void) @@ -407,6 +408,8 @@ gtk_tooltips_draw_tips (GtkTooltips *tooltips) style = tooltips->tip_window->style; widget = tooltips->active_tips_data->widget; + g_object_set_data (G_OBJECT (tooltips->tip_window), tooltips_info_key, + tooltips); keyboard_mode = get_keyboard_mode (widget); @@ -746,3 +749,42 @@ _gtk_tooltips_toggle_keyboard_mode (GtkWidget *widget) start_keyboard_mode (widget); } +/** + * gtk_tooltips_get_info_from_tip_window: + * @tip_window: a #GtkWindow + * @tooltips: the return location for the tooltips which are displayed + * in @tip_window, or %NULL + * @current_widget: the return location for the widget whose tooltips + * are displayed, or %NULL + * + * Determines the tooltips and the widget they belong to from the window in + * which they are displayed. + * + * This function is mostly intended for use by accessibility technologies; + * applications should have little use for it. + * + * Return value: %TRUE if @tip_window is displaying tooltips, otherwise %FALSE. + * + * Since: 2.4 + **/ +gboolean +gtk_tooltips_get_info_from_tip_window (GtkWindow *tip_window, + GtkTooltips **tooltips, + GtkWidget **current_widget) +{ + GtkTooltips *current_tooltips; + gboolean has_tips; + + g_return_val_if_fail (GTK_IS_WINDOW (tip_window), FALSE); + + current_tooltips = g_object_get_data (G_OBJECT (tip_window), tooltips_info_key); + + has_tips = current_tooltips != NULL; + + if (tooltips) + *tooltips = current_tooltips; + if (current_widget) + *current_widget = has_tips ? current_tooltips->active_tips_data->widget : NULL; + + return has_tips; +} diff --git a/gtk/gtktooltips.h b/gtk/gtktooltips.h index bd0b404771..c0ad3b1aa2 100644 --- a/gtk/gtktooltips.h +++ b/gtk/gtktooltips.h @@ -28,6 +28,7 @@ #define __GTK_TOOLTIPS_H__ #include +#include #ifdef __cplusplus @@ -102,6 +103,10 @@ void gtk_tooltips_force_window (GtkTooltips *tooltips); void _gtk_tooltips_toggle_keyboard_mode (GtkWidget *widget); +gboolean gtk_tooltips_get_info_from_tip_window (GtkWindow *tip_window, + GtkTooltips **tooltips, + GtkWidget **current_widget); + #ifdef __cplusplus } #endif /* __cplusplus */ -- 2.30.2